import request from '@/config/axios'

// 简历投递 VO
export interface RecruitmentResumeDeliveryVO {
  id: number // 编号
  deliveryUserId: number // 投递人
  positionId: number // 投递岗位
  status: number // 投递状态 0未查看1已查看2邀面试3面试中4已录用5未通过
}

// 简历投递 API
export const RecruitmentResumeDeliveryApi = {
  // 查询简历投递分页
  getRecruitmentResumeDeliveryPage: async (params: any) => {
    return await request.get({ url: `/hospital/recruitment-resume-delivery/page`, params })
  },

  // 查询简历投递详情
  getRecruitmentResumeDelivery: async (id: number) => {
    return await request.get({ url: `/hospital/recruitment-resume-delivery/get?id=` + id })
  },

  // 新增简历投递
  createRecruitmentResumeDelivery: async (data: RecruitmentResumeDeliveryVO) => {
    return await request.post({ url: `/hospital/recruitment-resume-delivery/create`, data })
  },

  // 修改简历投递
  updateRecruitmentResumeDelivery: async (data: RecruitmentResumeDeliveryVO) => {
    return await request.put({ url: `/hospital/recruitment-resume-delivery/update`, data })
  },

  // 删除简历投递
  deleteRecruitmentResumeDelivery: async (id: number) => {
    return await request.delete({ url: `/hospital/recruitment-resume-delivery/delete?id=` + id })
  },

  // 导出简历投递 Excel
  exportRecruitmentResumeDelivery: async (params) => {
    return await request.download({ url: `/hospital/recruitment-resume-delivery/export-excel`, params })
  },

  // 获取岗位候选人
  getCandidates: async (id: number) => {
    // return await request.get({ url: `/hospital/recruitment-position/getCandidates?id=` + id })
    return await request.get({ url: `/hospital/recruitment-resume/getCandidates?positionId=` + id })
  },

  // 查询简历投递详情
  getRecruitmentResume: async (id: number) => {
    return await request.get({ url: `/hospital/recruitment-resume/get?memberUserId=` + id })
  },

  // 查询教育经历
  getRecruitmentEducation: async (id: number) => {
    return await request.get({ url: `/hospital/recruitment-resume/recruitment-education/list-by-member-user-id?memberUserId=` + id })
  },

  // 查询工作经历
  getRecruitmentJob: async (id: number) => {
    return await request.get({ url: `/hospital/recruitment-resume/recruitment-job/list-by-member-user-id?memberUserId=` + id })
  },

}